Load sharing and redundancy scheme

ABSTRACT

Methods and apparatus for providing a device for forwarding packets in a network are disclosed. A first router and a second router having a shared set of interfaces are provided, enabling the first router and the second router to share forwarding data for forwarding packets on the shared set of interfaces.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to networking technology. Moreparticularly, the present invention relates to providing load sharingand redundancy in a network through a master router and a slave routerhaving a shared set of interfaces in a single device.

2. Description of the Related Art

Networks are commonly used by organizations for a variety of purposes.For instance, through the use of networks, resources such as programsand data may be shared by users of the network. In addition, a computernetwork can serve as a powerful communication medium among widelyseparated users.

Communication among hosts and users of a network is often facilitatedthrough connection to one or more routers. As shown in FIG. 1, a host112 normally resides on a network segment 114 that enables its networkentities to communicate with other entities or networks. Note that thehost 112 need not directly connect to the entities or networks withwhich it communicates. For example, as shown in FIG. 1, the host 112 maybe connected through a router R1 116. The router R1 116 may, in turn,connect one or more other routers such as router R2 118 with selectedentities or networks.

Now, suppose that the host 112 wishes to send a message to acorresponding node 120. A message from the host 112 is then packetizedand forwarded through the appropriate routers and to the correspondingnode 120, as indicated by dotted line “packet from host” 122, accordingto a standard protocol. If the corresponding node 120 wishes to send amessage to the host 112—whether in reply to a message from the host 112or for any other reason—it addresses that message to the IP address ofthe host 112 on the network segment 114. The packets of that message arethen forwarded to router R1 116 and ultimately to the host 112 asindicated by dotted line “packet to host” 124.

As described above, packets sent to and from the host 112 are forwardedvia the router R1 116. As shown, the router R1 116 is the only route toand from the host 112. Thus, if the router R1 116 fails, communicationwith the host 112 becomes impossible. Accordingly, the reliability ofthe network as well as the routers in the network is of utmostimportance.

As networks become a critical resource in many organizations, it isimportant that the networks are reliable. One way of achievingreliability is through redundancy. As described above, a single routerfailure may prevent communication to and from each host and userconnected to the router. In many networks, it is common to provideredundancy through the use of multiple routers such that a backup routerfunctions in the event of failure of a primary router. However, when theprimary router fails, there is typically a “switchover time” that isrequired for the backup router to take over the functions of the primaryrouter. As a result, such attempts to provide redundancy in switchessuffer from a large switchover time. Accordingly, it would be beneficialif such redundancy could be provided with a reduction in the switchovertime from a non-functional to a functional router.

In addition to reliability, it is often desirable to improve performancewithin a given network. In order to achieve this improvement, loadsharing is often preferable. For instance, various users of a networkmay have a higher traffic level than other users of the network. Itwould therefore be desirable if performance could be achieved throughthe distribution of traffic among multiple routers.

In view of the above, it would be desirable if a redundancy and loadsharing scheme could be implemented to reduce the switchover time uponfailure of a router while implementing a load sharing scheme amongmultiple routers operating in a single device.

SUMMARY OF THE INVENTION

An invention is described herein that provides load sharing andredundancy in a network. This is accomplished, according to oneembodiment, through the use of a master router and a slave routeroperating in the same chassis and having a shared set of interfaces.Prior to failure of the master router, the master router communicatesshared state information to the slave router. In addition, the slaverouter operates in “standby mode” to obtain information from the sharedset of interfaces. In this manner, the switchover time required toswitch from the master router to the slave router upon failure of themaster router is significantly reduced.

According to one aspect of the invention, a default gateway isassociated with both the master router and the slave router. This isaccomplished by assigning a shared IP address and a shared MAC addressto both a first router and a second router so that the shared IP and MACaddresses are shared between the first router and the second router.Additionally, a first MAC address is assigned to the first router and asecond MAC address is assigned to the second router. The default gatewayis configured on the hosts such that a default gateway IP address isassociated with the shared IP address. The shared IP and MAC addressesare associated with one of the routers (e.g., the first router or masterrouter). When the master fails, the slave takes over both the shared IPaddress and the shared MAC address.

In order to route traffic, there are three layers of protocol: aphysical layer, a data link layer, and a network layer. The data linklayer is often referred to as “layer 2” while the network layer is oftenreferred to as “layer 3.” The responsibility of the data link layer isto transmit chunks of information across a link. The responsibility ofthe network layer is to enable systems in the network to communicatewith each other. Thus, the network layer finds a path or “shortcut”through a series of connected nodes that must forward packets in thespecified direction.

According to another aspect, the master and the slave each includes aswitching processor to switch packets in hardware and a routingprocessor to enable packets to be routed in software. The switchingprocessor is adapted for running a layer 2 protocol (e.g., spanningtree) and the routing processor is adapted for running a layer 3 routingprotocol. In addition, the master and the slave each maintains its ownforwarding data. More particularly, the master and the slave eachmaintain a layer 2 database associated with the layer 2 protocol and arouting table associated with the layer 3 routing protocol. Both themaster and the slave independently run its own layer 3 routing protocoland maintain its own routing table. However, only the master runs thelayer 2 protocol. More particularly, the master saves the layer 2protocol information in a layer 2 protocol database (e.g., spanning treedatabase) and sends layer 2 protocol updates to the slave so that it maysimilarly store the layer 2 protocol updates in its own layer 2 protocoldatabase. When the master fails, the slave then runs the layer 2protocol and accesses its own layer 2 protocol database. Since the slavemaintains its own layer 2 protocol database and layer 3 routing table,switchover time upon failure of the master is minimized.

According to another aspect, prior to failure of the master, the slavereceives updates from the master in order to synchronize operation ofthe two routers. For instance, the master maintains the hardwareinformation for both the master and the slave. Therefore, in addition tosending layer 2 protocol updates, the master also sends otherinformation related to the hardware shared by the two routers. As oneexample, multicast group membership for the shared ports is sent by themaster to the slave. As another example, hardware information such astemperature and information related to the power supply is sent by themaster to the slave.

According to yet another aspect, the master and the slave each include aforwarding engine in addition to the routing processor and the switchingprocessor. The forwarding engines are adapted for forwarding packets inhardware and therefore increase the speed with which packets areforwarded. Each forwarding engine has an associated set of forwardingengine tables. More particularly, each forwarding engine includes alayer 2 table associating each destination MAC address with a port androuter. Thus, if a packet cannot be forwarded in hardware or it isundesirable to forward the packet in hardware, the packet is forwardedby the router specified in the layer 2 table. In addition, a layer 3shortcut table stores shortcuts (i.e., layer 3 forwarding information)for a path from a particular source IP address to a particulardestination IP address. When a router forwards a packet, a shortcut iscreated and entered in the layer 3 shortcut table. Packets may then beforwarded by the forwarding engine for this particular path.

According to another aspect, the slave operates to update its forwardingtables during standby mode as well as upon failure of the master. Inorder for the slave to forward a packet, the layer 2 table of theslave's forwarding engine must contain an entry associating the desireddestination MAC address with the slave router. Moreover, for theforwarding engine (i.e., hardware) of the slave to forward a packet,there must be an entry for the particular path from the source IPaddress to the destination IP address. Thus, prior to failure of themaster, the slave's forwarding engine observes packets at the sharedinterfaces to obtain information from the packet header to establishshortcuts. For instance, the slave may obtain a shortcut established bythe master from the packet header. The slave then updates its layer 2and layer 3 tables with an appropriate entry as necessary.

Upon failure of the master router, the slave modifies its forwardingengine tables to enable packets to be forwarded by the slave. At aminimum, in order to forward packets in software, the slave's layer 2table is modified to associate destination MAC addresses with the slaverather than the master. In addition, in order for a packet to beforwarded via the forwarding engine (i.e., hardware) of the slave, anentry for the specific path is identified in the slave's layer 3 table.Thus, if an entry exists in the slave's layer 3 table for the flow(e.g., path from source to destination) as provided in the packetheader, the packet may be forwarded by the forwarding engine. Even ifthe entry in the slave's layer 3 table for that particular flow is notmodified by the slave, packets may be forwarded using information in thecurrent entry using the shortcut established by the master (e.g., withthe source MAC address identifying the master). However, it is desirableto forward packets with the correct source MAC address (e.g., the MACaddress of the slave). According to one embodiment, since the master andthe slave routers may potentially arrive at different routing decisionsand therefore different shortcuts, the shortcuts established by themaster are invalidated. In order to invalidate these shortcuts, they areremoved from the slave's layer 3 shortcut table. However, if allshortcuts are removed simultaneously, a large number of packets willneed to be forwarded in software. Therefore, entries in the slave'slayer 3 shortcut table are selected and removed gradually. For example,the entries may be removed according to port number or other criteria.Once a packet is forwarded by the slave router in software, a correctentry is created and entered in the slave's shortcut table. Packets maythen be forwarded by the slave with a current shortcut as well ascorrect source MAC address. Thus, since the slave maintains its ownforwarding engine tables, packets may be forwarded with a minimum delaytime.

According to another aspect, the configuration of the master and theslave is synchronized. There are three categories of information thatmay be configured for each router. First, there is information that mustbe the same for both routers. Second, there is information that must bedifferent for both routers. Third, there is information that can bedifferent but is recommended to be the same for both routers. Thus, thesame configuration file may be maintained on both the master and theslave to enable the routers to be synchronized with these threecategories of information.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram illustrating communication between a host and acorresponding node via a router.

FIG. 2 is a diagram illustrating a system in which multiple routers areused to provide redundancy.

FIG. 3 is a general block diagram illustrating routers that share asingle set of interfaces according to in embodiment of the invention.

FIG. 4 is a diagram illustrating an exemplary configuration fileaccording to an embodiment of the invention.

FIG. 5 is a diagram illustrating a routing and switching systemaccording to one embodiment of the invention.

FIG. 6 is a process flow diagram illustrating one method of determiningwhich router is the master.

FIG. 7 is a block diagram illustrating a VLAN in which multiple LANs aregrouped together.

FIG. 8 illustrates an exemplary system for load sharing using VLANsaccording to an embodiment of the invention.

FIG. 9 is a block diagram illustrating a database configuration for therouting and switching system according to an embodiment of theinvention.

FIG. 10 is a process flow diagram illustrating one method of configuringthe master and slave routers at start up.

FIG. 11A is a process flow diagram illustrating one method of operatingthe master and slave prior to failure of one of the routers according toone embodiment of the invention.

FIG. 11B is a process flow diagram illustrating one method of forwardingpackets prior to failover.

FIG. 12A is a process flow diagram illustrating one method oftransitioning to the slave upon failure of the master according to anembodiment of the invention.

FIG. 12B is a process flow diagram illustrating one method of operatingupon failure of the slave according to an embodiment of the invention.

FIG. 12C is a process flow diagram illustrating one method of modifyingthe forwarding engine tables of the slave after failure of the masteraccording to an embodiment of the invention.

FIG. 12D is a process flow diagram illustrating one method of forwardingpackets by the slave as shown at block 1212 of FIG. 12B after failure ofthe master according to an embodiment of the invention.

FIG. 13A is a diagram illustrating an exemplary layer 2 table that maybe independently maintained by the master and the slave.

FIG. 13B is a diagram illustrating an exemplary layer 3 table that maybe independently maintained by the master and the slave router.

FIG. 14A is a diagram illustrating the need for second hop redundancywithin a network.

FIG. 14B is a diagram illustrating the problem created when second hopredundancy is not provided.

FIG. 15 is a block diagram of a network device that may be configured toimplement aspects of the present invention.

DETAILED DESCRIPTION OF THE INVENTION

In the following description, numerous specific details are set forth inorder to provide a thorough understanding of the present invention. Itwill be apparent, however, to one skilled in the art, that the presentinvention may be practiced without some or all of these specificdetails. In other instances, well known process steps have not beendescribed in detail in order not to unnecessarily obscure the presentinvention.

There are several ways to provide redundancy using multiple routers. Forinstance, two separate fully operational routers are often used toprovide redundancy. FIG. 2 is a diagram illustrating such a system. Asshown, a first router R1 102 and a second router R2 104 are supplied toprovide redundancy in a system supporting client 106. The first routerR1 102 and the second router R2 104 share a common interface 108. Inaddition, the first router R1 102 has an associated set of interfaces110 and the second router R2 104 has a separate set of interfaces 112.Thus, redundancy is commonly implemented to ensure that the client 106is supported in the event that one of the routers 102 and 104 fails. Itis important to note that where multiple routers are used, theytypically do not share the same interfaces. As a result, theconfigurations of the routers cannot be identical. Moreover, since thetwo routers are separate, the time to detect a failure of one of therouters is substantial.

In order to reduce the time required to detect a failure of one of therouters, the two routers may be provided in the same chassis. However,the interfaces are typically not easily shared between two routers. As aresult, the configuration information cannot be shared between therouters. Moreover, since the interfaces are not shared, both routerscannot be fully operational. Since both routers are not fullyoperational, when one of the routers fails, there is often a substantial“switchover time” during which the alternate router is brought up. Moreparticularly, during this time, the appropriate software is downloadedto the secondary router to enable the secondary router to take over theinterfaces associated with the primary router.

As described above, although multiple routers are commonly used toprovide redundancy in a network, the routers do not typically share aset of interfaces. As a result, the configurations of the routers arenot identical and therefore the switchover time in the event of failureof the primary router (i.e., master) may be substantial. To solve thisproblem, the present invention provides at least two routers that sharethe same set of interfaces. More particularly, since both routers sharethe same set of interfaces, both the routers may be fully operational.FIG. 3 is a general block diagram illustrating two routers provided inthe same chassis that share a single set of interfaces according to anembodiment of the invention. As shown, a first router 202 and a secondrouter 204 share a set of interfaces 206-1, 206-2, and 206-3. Since therouters 202 and 204 share the same set of interfaces, the routers mayshare at least some configuration information 208 and therefore theswitchover time as experienced by client 210 may be reduced. Since therouters 202 and 204 are in the same chassis 212, it is easier to ensurea similar configuration on both routers. For instance, both routers maybe configured via a single console. In addition to sharing configurationinformation, the routers may each provide updates to the other router.For instance, where R1 202 is the master and R2 204 is the slave,information such as spanning tree protocol updates may be sent from themaster to the slave as shown at 214.

According to one embodiment, two independent routers function in thesame chassis to seamlessly forward packets through the use of the HotStandby Redundancy Protocol (HSRP). According to the Hot StandbyRedundancy Protocol (HSRP), a protocol available from Cisco Systems,Inc. located in San Jose, Calif., the master router and the slave routershare a common MAC address and IP address. In addition, each of therouters has its own unique MAC address that will be used by the routerfor advertising routes to other routers. One of the routers acts as themaster and it responds to Address Resolution Protocol (ARP) queries forthe shared IP address with the shared MAC address. The default gatewaymay be configured by associating a default gateway IP address to theshared IP address. The IP to MAC binding may be either staticallyconfigured or obtained through the ARP protocol. When the master fails,the slave takes over both the shared IP address and the shared MACaddress that was owned by the master. Thus, a client need only know thedefault gateway IP to route packets.

In order to configure the routers, there are three categories ofinformation that may be configured for each router. First, there isinformation that must be the same for both routers. Second, there isinformation that must be different for both routers. Third, there isinformation that can be different but is recommended to be the same forboth routers. One desirable configuration for a set of routers havingthe same interfaces is described as follows. More particularly, theconfigurations that need to be the same include the number of ports ineach line card (i.e., router), the type of ports (e.g., type of VLAN towhich each port belongs), and security information (e.g., access lists).Configurations that need to be different include the IP addressesassociated with each interface of the routers. In other words, multiplerouters cannot have the same IP address for a particular interface. Inaddition, the priorities associated with each router are different inorder to enable load sharing among the different routers. Configurationsthat can be different but are recommended to be the same include routingprotocols and routing tables associated with the routers. One method ofimplementing load sharing is described below with reference to FIGS. 8Aand 8B.

According to a specific embodiment, in order to provide theconfiguration information for the routers sharing the same set ofinterfaces, a shared configuration file is created. FIG. 4 illustratesan exemplary shared configuration file. As shown, the configuration file402 includes configuration information in multiple command lines. Thecommand lines may be stored as text strings, as shown. Alternatively,the command lines may be stored in a binary format. The configurationmay be stored in non-volatile RAM such that when read, the routers mayhave all necessary information to operate. More particularly, as shown,each command line 404 identifies a particular configuration with aspecified router (e.g., router R1 or R2). In addition, where theconfigurations for the routers are different, when one router isconfigured, the configuration for the second router is forced. As shown,this may be accomplished by configuring both routers on the same commandline. By way of example, where the IP address 406 (e.g., 1.1.1.2) andassociated mask 410 are configured for a specified “master” router 412,an alternate “slave” router 414 may simultaneously be configured with anIP address 416 (e.g., 1.1.1.3) and a mask 418. More particularly, thetwo IP addresses 406 and 416 must be in the same subnet.

A more detailed diagram illustrating a routing and switching systemaccording to one embodiment of the invention is presented in FIG. 5. Asshown, in this embodiment, two independent operational routers R1 502and R2 504 are provided in a single chassis, permitting the routers tocommunicate in the backplane of the device. When redundancy isimplemented using HSRP, routers communicate their existence through“hello” packets. Thus, a failure of one of the routers is detected byanother router when a specified number of consecutive “hello” packetsare not received during a period of time. Since the routers communicatein the backplane of the device, a failure of one of the routers may bedetected in hardware. As a result, the time in which a failure of one ofthe routers may be detected is minimized. Each of the routers 502 and504 is shown in detail as including a corresponding routing processor506 and 508, switch processor 510 and 512, and forwarding engine 514 and516, respectively. More particularly, the routing processors 506 and 508run the layer 3 routing protocols. In addition, since the device alsofunctions as a bridge, the switch processors 510 and 512 are adapted forhandling the layer 2 protocols (e.g., spanning tree protocol) and maytherefore control the hardware by initializing the associated forwardingengines 514 and 516. However, since only one spanning tree will be used,only one of the switch processors runs the layer 2 spanning treeprotocol. Therefore, the master runs the layer 2 spanning tree protocoluntil the master fails, at which time the slave starts running the layer2 spanning tree protocol. The forwarding engines 514 and 516 may performforwarding in hardware and therefore each functions as a switch.

The slave maintains its own backup information, including layer 2 andlayer 3 tables. More particularly, the slave operates in standby modeand therefore obtains information by observing packets as they arereceived at the interfaces shared with the master. In addition, themaster sends selected information to the slave during normal operationof the master, as shown at 518. For instance, when the layer 2 spanningtree protocol is updated by the master, these spanning tree protocolupdates are communicated to the slave. Both the master and slave eachmaintain its own spanning tree database. Although only the master runsthe spanning tree protocol, the slave receives the spanning tree updatesfrom the master and stores the spanning tree updates in its own spanningtree database. As a result, the master and the slave have identicalspanning tree databases, thereby providing layer 2 redundancy. Althoughlayer 2 information is shared, information in layer 3 (i.e., routingtables) is not dynamically shared between the routers (e.g., by therouting processors), and therefore each router maintains a separaterouting table. In addition, each of the forwarding engines 514 and 516maintains its own tables, which will be described below with referenceto FIGS. 13A through 13C. Thus, the slave maintains its own forwardingengine tables, spanning tree database, and routing table. Since theslave maintains its own tables and receives information such as spanningtree updates from the master, switchover time is minimized upon failureof the master.

One of the routers may fail under a variety of circumstances. First, therouting processor of one of the routers may fail. Second, one of theswitch processors may fail. Third, one of the forwarding engines mayfail. According to one embodiment, any of these and other failures aretreated as a failure of the entire router.

While both routers are fully operational, only one functions as the“master” while the other functions as the “slave.” The master thereforeactively forwards packets while the slave functions in standby mode.When the master fails, the slave takes over to forward any remainingpackets. During initialization of the routing system, one of the routersis determined to be the “master”. A process flow diagram illustratingone method of determining which router is the master is presented inFIG. 6. Initialization of the routers as either master or slave beginsat block 600. At block 602, one of the routers receives a signal fromthe other router indicating which router is the master router. Accordingto one embodiment, the master sends a signal to the slave to assert thatit is the master. For instance, the first router to come up may assertsuch a signal. This is desirable since the first router to come up willhave a greater capacity for handling incoming and outgoing packets. Ifboth routers come up simultaneously, a priority previously assigned tothe routers may be used to determine which router will function as themaster. For instance, the priority associated with each router may beset up by a Network Administrator. If at block 604 it is determined thatthe signal asserts that the sending router is the master router, thereceiving router (i.e., the router receiving the signal) is determinedto be the slave at block 606. Otherwise, the receiving router isdetermined to be the master at block 608.

One or more default gateways may be configured using Hot StandbyRedundancy Protocol (HSRP)/Multigroup HSRP (M-HSRP) such that the masterwill be responsible for routing packets from a subset of interfaces andthe slave will be responsible for routing packets from the remaininginterfaces. HSRP/M-HSRP is a protocol available from Cisco Systems, Inc.located in San Jose, Calif. that provides a redundancy mechanism whenmore than one router is connected to the same segment of a network(e.g., Ethernet, FDDI, Token Ring). The participating routers share acommon predefined MAC address and IP address. In addition, each of therouters has its own unique MAC address which will be used by the routerfor advertising routes to other routers. In addition, this unique MACaddress will be used as the source MAC address portion of the routedpackets. One of the participating routers acts as the Master and itresponds to Address Resolution Protocol (ARP) queries for the shared IPaddress with the shared MAC address. The default gateway may beconfigured by associating a default gateway IP address to the shared IPaddress and the IP to MAC binding may be either statically configured orobtained through the ARP protocol. When the master fails, the slavetakes over both the shared IP address and the shared MAC address thatwas owned by the master. In this manner, the slave takes over themaster's interfaces upon failure of the master. Thus, a host (i.e.,client) need only know the default gateway IP to route packets. As aresult, the client need not be aware of which router is the masterrouter. Nor must the client be notified when one of the routers fails.

While one default gateway may be used, it may also be desirable to use adifferent default gateway for different groups of users. For instance,it may be desirable to configure a first set of users to use a firstdefault gateway and a second set of users to use a second defaultgateway. One way to logically group users together is through the use ofvirtual LANs (VLANs). FIG. 7 is a block diagram illustrating a VLAN inwhich multiple LANs are grouped together. As shown, router R1 702 has aplurality of interfaces that may connect to multiple LANs. As shown inFIG. 7, a first LAN 704 is coupled to a first interface 706, a secondLAN 708 is coupled to a second interface 710, a third LAN 712 is coupledto a third interface 714, and a fourth LAN 716 is coupled to a fourthinterface 718. As shown in FIG. 7, the first LAN 704 and the second LAN708 are coupled into first VLAN 724 while the third LAN 712 and thefourth LAN 716 are coupled into second VLAN 728. Bridging is used tocommunicate among LANs of the same VLAN while routing is used tocommunicate across VLANs. In this manner, LANs may be grouped togetheraccording to various criteria such as functionality or project.

As described above, packets are routed across VLANs. FIG. 8 illustratesan exemplary system for load sharing using VLANs according to anembodiment of the invention. Routers R1 800 and R2 802 are both shown tohave two interfaces, a first interface 804 and a second interface 810.The first interface 804 is connected to network segments 1.1.1.2 and1.1.1.3 to a first VLAN 808. Similarly, the second interface 810 isconnected to network segments 2.2.2.2 and 2.2.2.3 to a second VLAN 814.Multiple VLANs and clients 812 may be active on the same interface. As aresult, it may be desirable to distribute the load among the multiplerouters (i.e., R1 800 and R2 802) as well as accommodate the differenttraffic levels of each user. Thus, the requirements of each VLAN may bemet through load distribution among the routers R1 800 and R2 802.Moreover, the load may be distributed among the routers R1 800 and R2802 based upon the source of incoming packets to the routing system.More particularly, this may be accomplished through associating theusers and/or VLANs with different default gateways. In this manner, theunique requirements of the different VLAN groups as well as the userswithin each group may be separately accommodated. Accordingly, loadsharing can be achieved by configuring multiple groups between themaster and slave routers and thus directing traffic to both the routers.

As described above, the load (e.g., incoming load) may be distributedamong the master and the slave. For instance, suppose clients on VLAN 1and VLAN 2 have their default gateway configured to be the master andclients on VLAN 3 and VLAN 4 have their default gateway configured to bethe slave. More particularly, the hosts in VLAN 1 and VLAN 2 areconfigured with a default gateway of the default gateway IP address forthat group and the corresponding MAC address. Similarly, the hosts onVLAN 3 and VLAN 4 are configured with the slave's information. When oneof the two routers fails, the other router takes over the hosts servicedby the other router. For instance, when the master fails, the slaveservices the hosts on VLANs 1 and 2 in addition to the hosts on VLANs 3and 4. Moreover, since the slave is already a member of VLANs 1 and 2 asa separate router, it already has the appropriate routing informationand therefore does not have to recalculate any routing tables.

As described above with reference to FIG. 6, it is initially determinedwhich one of the routers is master. The routers may be prioritized toprovide redundancy as described above with reference to FIG. 6. Inaddition, load sharing may be implemented using default gateways asdescribed above with reference to FIGS. 7 and 8. In order for therouting and switching system to function in the event of failure of oneof the routers, the system is configured such that switchover time isminimized. This is accomplished, in part, through the maintaining andupdating of information for both the master and slave during normaloperation of the master. As a result, when the master fails, the timerequired to bring up the slave is minimized.

Typically, in a routing and switching system, the hardware and softwaremaintains layer 2 and layer 3 information in order to forward packets.According to one embodiment of the invention, each of the routers andforwarding engines maintains its own layer 2 and layer 3 data. As shownin FIG. 9, although the routers are provided in a single chassis, eachof the routers 902 and 904 has its own layer 3 routing table 906 and 908as well as its own layer 2 spanning tree database 910 and 912,respectively. In addition, associated forwarding engines 914 and 916each maintain a set of forwarding engine tables. As shown, the firstforwarding engine 914 has a set of forwarding engine tables 918including a layer 2 table 920 and layer 3 shortcut table 922. Inaddition, the second forwarding engine 916 has a set of forwardingengine tables 924 including a layer 2 table 926 and layer 3 shortcuttable 928. Where the first router 902 is the master and the secondrouter 904 is the slave, the master sends information such as spanningtree updates to the slave, as shown at line 930. In addition, the slaveand master routers 902 and 904 each maintains its own routing table 906and 908, respectively, through routing updates received from otherrouters in the network. Similarly, each forwarding engine 914 and 916updates its associated forwarding engine tables 918 and 924,respectively, through information obtained from packet headers ofpackets observed at the shared interfaces (not shown to simplifyillustration).

In addition to determining which router is the master, both routers mustbe brought up such that they are fully functional. One method ofconfiguring the master and slave routers at start up is presented inFIG. 10. As shown, the process at start up begins at block 1000 and therouters are brought up at block 1002. The configuration information isread from the configuration file for both routers at block 1004. Asdescribed earlier, the configuration information may fall in one ofthree categories. The routers start running the routing protocols atblock 1006. The routing protocols of the two routers may be different,but are recommended to be the same. Each router then builds its ownrouting table as shown at block 1008. The routing tables are notsynchronized. As known to those of ordinary skill in the art, therouters dynamically exchange routing updates. Each router then updatesits own routing table based upon the information gathered in each of therouting updates.

Once both routers are fully functional, the master and slave continue tocommunicate information prior to failure of one of the routers. As shownin FIG. 11A, a method of operating the master and slave prior to failureof one of the routers according to one embodiment of the invention ispresented. The process begins at block 1100 and at block 1102, asynchronization task runs in master/slave mode and the master sends tothe slave synchronized state information to synchronize the port statesand forward delay time. By way of example, the state of each port mayindicate that the link is up or down, that the port is blocked,listening, or forwarding.

Both the master and the slave run layer 3 routing protocols andtherefore each maintains its own routing table. However, only one of therouters runs the layer 2 spanning tree protocol at any given point intime. More particularly, prior to failure of the master router, themaster runs the layer 2 spanning tree protocol. Only upon failover ofthe master router does the slave router run the layer 2 spanning treeprotocol. Thus, at block 1104, the master sends a spanning tree updateto the slave (e.g., specifying spanning tree states). For instance, thespanning tree update may indicate the states of the ports. Next, atblock 1106, the slave acknowledges the spanning tree updates. The slavethen updates its own spanning tree database such that the slave'sspanning tree database is substantially identical to that maintained bythe master. In addition, the VLAN membership of the master is sent tothe slave at block 1108. In this manner, the slave may quickly determinewhich VLANs it will be supporting when the master fails. Forwardingengine information is then sent by the master to the slave to initializethe hardware of the slave at block 1110. Forwarding engine informationmay include, but is not limited to, port membership (i.e., associationbetween ports and receivers), multicast group membership (e.g., whichports are members of which multicast groups). In addition, hardwareinformation may be sent as necessary by the master to the slave at block1112. Hardware information may include, but is not limited to,temperature and indication of power supply failure.

FIG. 11A describes a method of operating the master router prior tofailure of the master router. In addition, when a packet is received atthe shared set of interfaces and forwarded by the master, the forwardingengine tables are updated by both the master and the slave. One methodof forwarding packets prior to failover is presented in FIG. 11B. Theprocess begins at block 1116 and at block 1118, the master receives apacket at the shared set of interfaces. Thus, the master obtainsinformation from the packet header while actively forwarding the packet.Although the master may send this information to the slave via software,this is a time-consuming process. Since it is necessary for the slave toobtain the information required for its forwarding engine tables in aless time-consuming manner, the slave operates during “standby mode” toobserve incoming and outgoing packets at the set of shared interfaces.Thus, the slave independently obtains information from the packetobserved at the shared set of interfaces at block 1120. The master thenupdates the master's forwarding engine tables at block 1122, asnecessary, with an entry associated with the packet. Exemplaryforwarding engine tables will be shown and described with reference toFIGS. 13A and 13B. Similarly, at block 1124 the slave updates theslave's forwarding engine tables as necessary with an entry associatedwith the packet. The master then forwards the packet at block 1126.Therefore, at any given point in time, both the slave and the masterwill have essentially identical forwarding engine tables.

As described above, according to one embodiment, a failure of thehardware (i.e., switching engine) or software (i.e., routing processoror switch processor) in a router is treated as a failure of the entirerouter. FIG. 12A is a process flow diagram illustrating a method oftransitioning to the slave upon failure of the master according to oneembodiment of the invention. Upon failure of the master at 1200, abackplane signal is sent to the slave at block 1202. The slave thenstarts the layer 2 spanning tree protocols at block 1204. At block 1206,the slave then uses the synchronized state information previously sentby the master to the slave as shown at block 1102 of FIG. 11A. It isimportant to note that the slave typically starts at ground zero toobtain such synchronized state information. Since the slave need notstart from ground zero, the failover time is substantially reduced.

As described above, in order to provide load sharing in the routingsystem, certain interfaces may have a specified default gateway (e.g.,R1). Thus, when R1 fails, R2 must be specified as the new defaultgateway so that the forwarding engine tables may be modifiedaccordingly. Exemplary forwarding engine tables and mechanisms formodifying these tables will be described in further detail below withreference to FIGS. 12C, 13A and 13B. Thus, at block 1208, the routingprocessor of the slave sends a signal to the forwarding engine toreplace the references to the MAC address and IP address of the masterwith the MAC address and IP address of the slave, where appropriate. Theforwarding engine tables of the slave are then modified at block 1210 sothat packets may then be forwarded by the slave router at block 1212. Anexemplary method of modifying the forwarding engine tables will bedescribed with reference to FIG. 12C and exemplary forwarding enginetables will be described in further detail with reference to FIGS. 13Aand 13B.

When the slave fails, the slave merely notifies the master of itsfailure. As shown in FIG. 12B, when the slave fails 1220, a signal issent to the master at block 1222.

Packets received at the shared interfaces may be forwarded in hardwarevia the forwarding engine or in software. However, packets must beencapsulated in the same manner regardless of whether the packets areforwarded in hardware or software. Thus, similarly to the informationmaintained by the routing processor and switching processor, theforwarding engines maintain layer 2 and layer 3 tables, as will be shownand described. with reference to FIGS. 13A and 13B. As shown at block1210 of FIG. 12A, the forwarding engine tables of the slave are modifiedafter failure of the master to enable packets to be accurately forwardedby the slave. One method of modifying the forwarding engine tables ofthe slave after failure of the master is presented in FIG. 12C. Theprocess begins at block 1230. In the absence of a layer 3 entry for aparticular flow, a packet following this flow is sent via software. Inorder to determine the router used to send the packet, the layer 2 tableis used to match the destination MAC address of the packet and thereforemust contain updated information. Thus, at block 1232, entries in theslave's layer 2 table that are associated with the master are modifiedor replaced such that the resulting entries are mapped to the slaverather than the master. Once modified, the slave's layer 2 table may beused to determine the appropriate router to forward packets in theabsence of an entry in the slave's layer 3 table. During forwarding of apacket, if there is no layer 3 entry, an entry in the layer 2 tableassociated with the destination MAC address of the packet is identified.The router identified in this layer 2 table entry is then used toforward the packet in software until a layer 3 entry for this flow iscreated.

In addition, the slave's layer 3 shortcut table is modified. Since theslave and the master share the same interfaces and are independentlyrunning routing protocols, they both should arrive at the same routingdecision for a particular IP destination. However, there is no guaranteethat all the routing updates will reach and get processed by both theslave and the master all the time. In theory, both the master and theslave will come to the same routing decisions. In addition, shortcuts inthe router's layer 3 table are established upon forwarding of a packetby the router based upon information in its routing table. However,since the slave and the master operate independently, the shortcutscannot be guaranteed to be identical for both the master and the slave.Moreover, these potentially invalid shortcuts take up space in a limitedamount of space in the layer 3 table in hardware. Therefore, theshortcuts created by the master are invalidated on failover. As aresult, at block 1234, selected entries associated with the master areremoved from the slave's layer 3 table. Prior to removal of the entriesfrom the slave's layer 3 table, packets may be routed via the slave'sforwarding engine using the master's MAC address as the source MACaddress. Once an entry for a particular flow is removed, packets may beforwarded in software until a new entry for the flow is created in theslave's layer 3 table. Later, when a packet belonging to the same flow(e.g., from the source IP address to the destination IP address) isrouted by the slave, this removed entry is effectively “replaced” withan entry associated with the slave for this same “flow.” Once the entryis replaced, packets may be routed via the slave's forwarding engineusing the slave's MAC address as the source MAC address. In addition, onswitchover, the floating default gateway IP address and the associatedfloating MAC address is now associated with the slave (e.g., with theMAC address of the slave). Accordingly, in order to enable forwarding bythe slave's forwarding engine upon failure of the master without aperiod of delay, the shortcuts created by the master are used in theinterim period after failure of the master and prior to updating theslave's layer 3 shortcuts.

As described above with reference to FIG. 12C, packets may be forwardedby the slave router in hardware or software. Moreover, when the packetis forwarded in hardware (by the slave's forwarding engine) the sourceMAC address may be that of the master or the slave depending upon thestatus of the slave's forwarding engine tables. A flow diagramillustrating one method of forwarding packets by the slave as shown atblock 1212 of FIG. 12B after failover of the master is presented in FIG.12D. The process begins at block 1240 and at block 1242, the slavedetermines whether the packet is to be forwarded in software. Forinstance, even after the slave's layer 2 table has been modified, ifthere is no entry in the slave's layer 3 table for the path specified bythe packet's header, the packet is forwarded in software. Thus, it isdetermined whether an entry associated with the packet is present in thelayer 3 table. More particularly, using information in the packetheader, it is determined whether the layer 3 table includes an entryassociated with the source IP address and the destination IP address ofthe packet. If the layer 3 table does not include such an entry, thepacket is routed in software until an entry has been created for thespecified flow (i.e., path from source to destination). Moreover, ifforwarding of the packet requires extra processing that cannot beperformed or is difficult to perform in hardware, the packet isforwarded in software. The packet is then forwarded in software at block1244 using the slave's routing tables and spanning tree protocoldatabase. Once the packet is routed, an entry is created in the layer 3table such that the source MAC address is that of the slave at block1246.

As described above, if the slave's layer 3 table does not include anentry associated with the packet or it would otherwise be difficult orimpossible to forward the packet in hardware, the packet is forwarded insoftware. Otherwise, the packet is routed via the forwarding engine andthe process continues at block 1248 where it is determined whether theslave's layer 3 table includes a new or modified entry associated withthe path of the packet to be forwarded. The packet is then forwardedwith the appropriate source MAC address and destination MAC address asspecified by the entry in the layer 3 table. More particularly, if thelayer 3 table contains an entry that has not been removed or modified bythe slave, the source MAC address identifies the master. However, if thelayer 3 table includes an entry that has been created or modified by theslave, the source MAC address identifies the slave. Thus, if it isdetermined at block 1248 that the slave's layer 3 table does not includea new entry created by the slave, the packet is forwarded via theforwarding engine using the slave's forwarding engine tables and thesource MAC address of the master at block 1250. If the slave's layer 3table does include a new entry created by the slave, the packet isforwarded via the forwarding engine using the slave's forwarding enginetables and the source MAC address of the slave at block 1252.

Since both the slave and the master are independent operational routers,they may each come to different routing decisions. As a result, theslave and the master each maintains its own set of forwarding enginetables. Since the slave and the master share the same set of interfaces,the slave may observe incoming and outgoing packets and thereforeobtains information to update its layer 2 and layer 3 tables. Moreparticularly, prior to failure of the master, the master monitors alltraffic entering the switch during active forwarding of packets whilethe slave monitors all traffic entering the switch while the slave is instandby mode. Thus, while the master's forwarding engine is activelyforwarding packets, the slave is learning information from the bus(e.g., incoming packets). Once the master fails, the slave activelyforwards packets and monitors all traffic coming into the switch, as themaster did prior to its failure.

Exemplary forwarding engine tables are described with reference to FIGS.13A and 13B. More particularly, FIG. 13A is a diagram illustrating anexemplary layer 2 table that may be independently maintained by themaster and the slave. The layer 2 table serves as a bridge forwardingdatabase and therefore is used to determine the LAN and port used tosend packets out. During normal operation, prior to failure of themaster, both the slave and the master each monitor all traffic cominginto the switch. Based upon the header of the incoming packet, an entryin the corresponding layer 2 table is created. As shown, the layer 2table 1302 specifies a MAC address 1304 of a host as specified by thesource MAC address of the incoming packet, an associated VLAN 1306 towhich the host belongs, and a port 1308 that the packet has come in on.In addition, each entry is associated with a router 1309 (e.g.,identified with the destination MAC address of the incoming packet),which may be accomplished in the layer 2 table or in a separate mappingtable. For instance, the router 1309 may specify the slave or the masterrouter. However, upon failure of the master, the slave modifies itslayer 2 table entries to specify the slave as the router. When an entryfor a particular flow is not in the layer 3 table, the packet is routedvia a router associated with that flow. More particularly, an entry inthe layer 2 table (or a separate mapping table) is matched with thedestination MAC address as specified in the packet header. In thismanner, the outgoing VLAN and outgoing port for a specified destinationMAC address may be obtained from information learned from previouslyreceived incoming packets.

In addition, the master and the slave router each maintains its ownlayer 3 shortcut table. FIG. 13B is a diagram illustrating an exemplarylayer 3 table 1310 that may be maintained by the master and the slaverouter. As shown, each entry in the L3 routing table specifies adestination IP address 1312, a source IP address 1314, a destination MACaddress 1316, and a source MAC address 1318. As described above, sincethe slave and master share a single set of interfaces and therefore thesame packet information, when a packet is forwarded by the master (e.g.,by the routing processor), a shortcut is established and a correspondingentry is entered into the layer 3 table of the slave as well as that ofthe master. More particularly, the slave obtains the shortcut previouslyestablished by the master from the packet header. Prior to failure ofthe master, the slave's forwarding engine is in standby mode. During thestandby mode, the slave's forwarding engine learns information from thebus (e.g., from the headers of the incoming packets) and updates itslayer 3 shortcut table. As a result, the slave and the master haveaccess to substantially identical layer 3 tables. In summary, duringactive forwarding of the master and during standby mode of the slave,layer 3 table entries are learned by the forwarding engine of both themaster and the slave from the packet header via the shared interfacesbetween the two routers.

As described above with reference to block 1210 of FIG. 12A, when themaster fails, the forwarding engine tables are modified. Moreparticularly, as described above with reference to FIG. 13A, the layer 2table of the slave is modified to replace references to the master withreferences to the slave such that each entry is mapped to the slaverather than the master. In addition, once the slave's layer 2 table hasbeen modified, entries associated with the master may be identified andremoved from the layer 3 table so that the source of the packet iscorrectly identified in the packet header. In other words, the layer 3shortcuts established by the master are purged from the layer 3 table.However, as described above, where an entry does not exist in theslave's layer 3 table for a particular path, the packet is forwarded insoftware. Thus, if all entries in the slave's layer 3 table that havebeen established by the master are removed simultaneously, a substantialamount of traffic may be forwarded in software. However, the forwardingrate in hardware is much higher than that provided in software. It istherefore desirable to delete these entries in the slave's layer 3 tablegradually to reduce the traffic forwarded in software. For instance, inorder to stagger the traffic handled by the CPU of the slave, theentries in the slave's layer 3 table that have been created by themaster may be modified one interface/port or VLAN at a time.Subsequently, when a packet is received by the slave, a shortcut isautomatically established by the forwarding engine of the slave frominformation provided in the packet header. The slave's forwarding enginethen enters this shortcut in the slave's layer 3 table. Thus, the newentry in the slave's layer 3 table correctly identifies the slave as thesource of the packet. In this manner, the shortcuts established by themaster are replaced with those established by the slave. The packet maythen be switched via hardware. In this manner, the traffic handled byhardware is maximized.

When a first host wishes to communicate with a second host, it is oftennecessary to communicate via one or more routers. Where both hosts aredirectly connected to a single router, communication is accomplishedthrough a single router or “hop.” When packets must be sent via multiplerouters, multiple “hops” are required. The present invention is designedto provide first hop as well as second hop routing redundancy for hosts.More particularly, when the master to slave switchover takes place, allpackets from the host will be forwarded seamlessly to the destination.However, packets in the reverse direction must also be forwardedcorrectly even though the master has failed. This problem will bedescribed with reference to the following figures.

As shown in FIG. 14A, a master-slave routing and switching system 1402having a first router 1404 and a second router 1406 as described aboveis provided. In addition, a third router 1408 that is outside therouting and switching system 1402 is coupled to the routing andswitching system 1402. As shown, the three routers 1404, 1406, and 1408support a first VLAN 1410 and a second VLAN 1412. In the followingexample, a first host 1414 sends packets to a second host 1416 as wellas receives packets from the second host 1416. For purposes of thefollowing discussion, the first host 1414 has its default gatewayconfigured with the IP address identifier and the default MAC addressidentifier of the default gateway. Through the default IP addressidentifier and the default MAC address identifier, the first router 1404is then configured as the default gateway for the first VLAN 1410.

When the first host 1414 sends a packet to the first router 1404, thefirst router 1404 routes the packet to the third router 1408 to reachthe final destination, the second host 1416, as shown at line 1418.Packets sent from the second host 1416 to the first host 1414 alsofollow the same path in the reverse direction.

When the first router 1404 fails, the second router 1406 becomes thedefault gateway for the first VLAN 1410 and therefore packets sent bythe first host 1414 are now redirected to the second router 1406, asshown in FIG. 14B by line 1420. The second router 1406 will then routethe packets to the third router 1408 which will finally forward thepackets to the destination, the second host 1416. However, the reversetraffic from the second host 1416 will get forwarded by the third router1408 to the first router 1414 since the third router 1408 has notdiscovered that the first router 1404 has died. Depending on the routingprotocols used, the time it takes for the third router 1408 to decidethat the first router 1404 has failed and to recalculate its routesvaries. Moreover, this time is much greater than the time it takes forthe second router 1406 (i.e., slave) to realize that the first router1404 (i.e., master) has died according to the present invention.

To avoid “blackholing” of this reverse traffic, the traffic destined forthe actual MAC address of the first router 1404 will be diverted to thesecond router 1406. Moreover, the second router 1406 avoids forwardingtraffic back to the first router 1404. In addition, control packetsdestined for the first router 1404 will not be processed by the secondrouter 1406. In this manner, reverse traffic will be forwarded by thesecond router 1406 (i.e., slave) and second hop redundancy isimplemented.

Generally, the load sharing and redundancy technique of the presentinvention may be implemented on software and/or hardware. For example,it can be implemented in an operating system kernel, in a separate userprocess, in a library package bound into network applications, on aspecially constructed machine, or on a network interface card. In aspecific embodiment of this invention, the technique of the presentinvention is implemented in software such as an operating system or inan application running on an operating system.

A software or software/hardware hybrid load sharing and redundancysystem of this invention is preferably implemented on a general-purposeprogrammable machine selectively activated or reconfigured by a computerprogram stored in memory. Such programmable machine may be a networkdevice designed to handle network traffic. Such network devicestypically have multiple network interfaces including frame relay andISDN interfaces, for example. Specific examples of such network devicesinclude routers and switches. For example, the load sharing andredundancy systems of this invention may be specially configured routerssuch as specially configured router models 1600, 2500, 2600, 3600, 4500,4700, 7200, 7500, and 12000 and Catalyst switches such as models 5000and 6000 available from Cisco Systems, Inc. of San Jose, Calif. Ageneral architecture for some of these machines will appear from thedescription given below. In an alternative embodiment, the load sharingand redundancy system may be implemented on a general-purpose networkhost machine such as a personal computer or workstation. Further, theinvention may be at least partially implemented on a card (e.g., aninterface card) for a network device or a general-purpose computingdevice.

Referring now to FIG. 15, a router 1440 suitable for implementing thepresent invention includes a master central processing unit (CPU) 1462,interfaces 1468, and a bus 1415 (e.g., a PCI bus). When acting under thecontrol of appropriate software or firmware, the CPU 1462 is responsiblefor such router tasks as routing table computations and networkmanagement. It may also be responsible for functions previouslydescribed, such as maintaining layer 2 spanning tree protocol databases,modifying forwarding engine tables of the slave router, etc. Itpreferably accomplishes all these functions under the control ofsoftware including an operating system (e.g., the Internetwork OperatingSystem (IOS®) of Cisco Systems, Inc.) and any appropriate applicationssoftware. CPU 1462 may include one or more processors 1463 such as aprocessor from the Motorola family of microprocessors or the MIPS familyof microprocessors. In an alternative embodiment, processor 1463 isspecially designed hardware for controlling the operations of router1440. In a specific embodiment, a memory 1461 (such as non-volatile RAMand/or ROM) also forms part of CPU 1462. However, there are manydifferent ways in which memory could be coupled to the system.

The interfaces 1468 are typically provided as interface cards (sometimesreferred to as “line cards”). Generally, they control the sending andreceiving of data packets over the network and sometimes support otherperipherals used with the router 1440. Among the interfaces that may beprovided are Ethernet interfaces, frame relay interfaces, cableinterfaces, DSL interfaces, token ring interfaces, and the like. Inaddition, various very high-speed interfaces may be provided such asfast Ethernet interfaces, Gigabit Ethernet interfaces, ATM interfaces,HSSI interfaces, POS interfaces, FDDI interfaces and the like.Generally, these interfaces may include ports appropriate forcommunication with the appropriate media. In some cases, they may alsoinclude an independent processor and, in some instances, volatile RAM.The independent processors may control such communications intensivetasks as packet switching, media control and management. By providingseparate processors for the communications intensive tasks, theseinterfaces allow the master microprocessor 1462 to efficiently performrouting computations, network diagnostics, security functions, etc.

Although the system shown in FIG. 15 is one specific router of thepresent invention, it is by no means the only router architecture onwhich the present invention can be implemented. For example, anarchitecture having a single processor that handles communications aswell as routing computations, etc. is often used. Further, other typesof interfaces and media could also be used with the router.

Regardless of network device's configuration, it may employ one or morememories or memory modules (including memory 1461) configured to storeprogram instructions for the general-purpose network operations andother load sharing and redundancy functions described herein. Theprogram instructions may control the operation of an operating systemand/or one or more applications, for example. The memory or memories mayalso be configured to store routing tables, layer 2 databases,forwarding engine tables, etc.

Because such information and program instructions may be employed toimplement the systems/methods described herein, the present inventionrelates to machine readable media that include program instructions,state information, etc. for performing various operations describedherein. Examples of machine-readable media include, but are not limitedto, magnetic media such as hard disks, floppy disks, and magnetic tape;optical media such as CD-ROM disks; magneto-optical media such asfloptical disks; and hardware devices that are specially configured tostore and perform program instructions, such as read-only memory devices(ROM) and random access memory (RAM). The invention may also be embodiedin a carrier wave travelling over an appropriate medium such asairwaves, optical lines, electric lines, etc. Examples of programinstructions include both machine code, such as produced by a compiler,and files containing higher level code that may be executed by thecomputer using an interpreter.

Although illustrative embodiments and applications of this invention areshown and described herein, many variations and modifications arepossible which remain within the concept, scope, and spirit of theinvention, and these variations would become clear to those of ordinaryskill in the art after perusal of this application. For instance,although the specification has described routers, other entities used totunnel packets to mobile nodes on remote network segments can be used aswell. For example, bridges or other less intelligent packet switches mayalso employ the standby protocol of this invention. Accordingly, thepresent embodiments are to be considered as illustrative and notrestrictive, and the invention is not to be limited to the details givenherein, but may be modified within the scope and equivalents of theappended claims.

What is claimed is:
 1. A device for forwarding packets in a network,comprising: a first router having a first processor and a first memoryassociated therewith; and a second router having a second processor anda second memory associated therewith, the first router and the secondrouter having a shared set of interfaces, the shared set of interfacesenabling the first router and the second router to share forwarding datafor forwarding packets on the shared set of interfaces and to shareupdates including at least one of synchronized state informationindicating states of ports associated with the set of interfaces andVLAN membership.
 2. The device as recited in claim 1, wherein the firstrouter and the second router are provided in a single device, therebyenabling communication between the first router and the second router,wherein the communication occurs in a backplane of the device such thatthe first router replaces the second router upon detection of failure ofthe second router.
 3. The device as recited in claim 1, wherein thefirst memory includes a first set of forwarding data associated with thefirst router; and the second memory includes a second set of forwardingdata associated with the second router, the first set of forwarding dataand the second set of forwarding data comprising layer 2 protocolinformation and layer 3 protocol information for forwarding packets;wherein the first set of forwarding data associated with the firstrouter includes forwarding data updates sent from the second router tothe first router prior to the failure of the second router.
 4. Thedevice as recited in claim 3, wherein the forwarding data updatesinclude layer 2 protocol updates.
 5. The device as recited in claim 3,wherein the first set of forwarding data associated with the firstrouter further includes data obtained by the first router from theshared set of interfaces prior to the failure of the second router. 6.The device as recited in claim 5, wherein the data obtained by the firstrouter includes one or more shortcuts established by the second router,the one or more shortcuts specifying layer 3 forwarding information. 7.The device as recited in claim 1, further comprising a memory coupled toat least one of the routers, the memory storing a set of configurationinformation for configuring the first router and the second router. 8.The system as recited in claim 7, wherein the set of configurationinformation comprising a number of ports associated with both the firstrouter and the second router, a type of the ports associated with boththe first router and the second router, and a single set of securityinformation associated with both the first router and the second router.9. A method of forwarding packets in a network, comprising: providing afirst router; providing a second router, the first router and the secondrouter sharing a single set of interfaces; sending synchronized stateinformation indicating states of ports associated with the set ofinterfaces and VLAN membership information via the set of interfaces;and detecting a failure of the second router such that the first routerforwards packets received at the single set of interfaces in response tothe detection of failure of the second router.
 10. The method as recitedin claim 9, further including providing the first router and the secondrouter in a single device, wherein the failure is detected through asignal sent within the device from the second router to the firstrouter.
 11. The method as recited in claim 9, further comprising:maintaining a first set of forwarding data associated with the firstrouter; maintaining a second set of forwarding data associated with thesecond router, the first set of forwarding data and the second set offorwarding data comprising layer 2 protocol information and layer 3protocol information for forwarding packets; sending forwarding dataupdates from the second router to the first router prior to the failureof the second router; and updating the first set of forwarding dataassociated with the first router with the forwarding data updates sentfrom the second router.
 12. The method as recited in claim 11, whereinthe forwarding data updates include layer 2 protocol updates.
 13. Themethod as recited in claim 11, further comprising: obtaining data fromthe shared set of interfaces by the first router prior to the failure ofthe second router; and incorporating the obtained data in the first setof forwarding data.
 14. The method as recited in claim 13, wherein thedata obtained by the first router includes one or more shortcutsestablished by the second router, the one or more shortcuts specifyinglayer 3 forwarding information.
 15. The method as recited in claim 9,further comprising: assigning a shared IP address and shared MAC addressto the first router and the second router; assigning a first MAC addressto the first router; assigning a second MAC address to the secondrouter; and configuring a default gateway such that a default gateway IPaddress is associated with the shared IP address.
 16. The method asrecited in claim 15, further comprising: associating the shared IPaddress with the first MAC address.
 17. The method as recited in claim16, further comprising: associating the shared IP address with thesecond MAC address in response to a failure of the first router.
 18. Themethod as recited in claim 15, wherein configuring a default gatewayincludes configuring a first default gateway and a second defaultgateway, the method further comprising: associating a first host with afirst default gateway; and associating a second host with a seconddefault gateway, wherein the first default gateway and the seconddefault gateway are identified with at least one of the first router andthe second router, thereby enabling a packet to be forwarded via thefirst or the second default gateway when at least one of the source anddestination of the packet identifies the first host or the second host.19. The method as recited in claim 9, further comprising: determiningwhether the first router or the second router functions as a masterrouter.
 20. The method as recited in claim 19, wherein determiningwhether the first router or the second router functions as a masterrouter comprises: ascertaining from priorities assigned to the firstrouter and the second router which of the first router and the secondrouter functions as the master router.
 21. The method as recited inclaim 19, wherein determining comprises: receiving a signal at the firstrouter from the second router; ascertaining whether the signal assertsthat the second router is the master router; wherein when it isascertained that the signal asserts that the second router is the masterrouter, it is ascertained that the first router is the slave router; andwherein when it is ascertained that the signal does not assert that thesecond router is the master router, it is ascertained that the firstrouter is the master router.
 22. The method as recited in claim 9,further comprising: reading a configuration file for configurationinformation for both the first router and the second router, wherein atleast some of the configuration information is identical for the firstrouter and the second router.
 23. In a master router, a method offorwarding packets received at a set of interfaces, the methodcomprising: maintaining a routing table; running a protocol; updating adatabase in the master router with updates, the updates including atleast one of synchronized state information indicating states of portsassociated with the set of interfaces and VLAN membership of the masterrouter; and sending the updates to a slave router, thereby enabling theslave router to forward packets received at the set of interfaces usingthe updates received from the master router.
 24. The method as recitedin claim 23, wherein the protocol is a layer 2 protocol and the updatesinclude layer 2 protocol updates, wherein sending the updates comprises:sending synchronized state information from the master router to theslave router to synchronize states of ports associated with the set ofinterfaces.
 25. The method as recited in claim 23, wherein the updatesdo not include information associated with the routing table maintainedby the master router, wherein sending the updates comprises: sendingVLAN membership of the master router to the slave router such that theslave has access to each VLAN associated with the master router uponfailure of the master router.
 26. The method as recited in claim 23,wherein sending the updates comprises: sending synchronized stateinformation from the master router to the slave router to synchronizestates of ports associated with the set of interfaces; and sending VLANmembership of the master router to the slave router such that the slavehas access to each VLAN associated with the master router upon failureof the master router.
 27. The method as recited in claim 26, furthercomprising: using the synchronized state information on the slave routerin response to a detection of failure of the master router.
 28. Themethod as recited in claim 23, further including: sending forwardingengine information from the master router to the slave router such thatthe second forwarding engine is initialized; and sending hardwareinformation from the master router to the slave router, the hardwareinformation including at least one of temperature and indication ofpower supply failure.
 29. In a slave router, a method of forwardingpackets received at a set of interfaces, the method comprising:maintaining a routing table; receiving updates from a master routerrunning a protocol, the updates including at least one of synchronizedstate information indicating states of ports associated with the set ofinterfaces and VLAN membership of the master router; and updating adatabase with the updates received from the master router, therebyenabling the slave router to forward packets received at the set ofinterfaces upon failure of the master router.
 30. The method as recitedin claim 29, wherein the protocol is a layer 2 protocol and the updatesinclude layer 2 protocol updates.
 31. The method as recited in claim 29,wherein the updates do not include information associated with a layer 3protocol.
 32. The method as recited in claim 29, further comprising:detecting a failure of the master router; and running the protocol onthe slave router.
 33. The method as recited in claim 29, furthercomprising: sending acknowledgement of the updates from the slave routerto the master router.
 34. A method of forwarding packets in a switchingsystem, the system comprising a master router and a slave router havinga shared set of interfaces, the method comprising: maintaining a firstset of forwarding data for the master router and a second set offorwarding data for the slave router; sending forwarding data updatesfrom the master router to the slave router; sending at least one ofsynchronized state information indicating states of ports associatedwith the set of interfaces and VLAN membership of the master router tothe slave router; obtaining packet header data from the shared set ofinterfaces; and updating the second set of forwarding data with theforwarding data updates sent from the master router and the packetheader data obtained from the shared set of interfaces.
 35. The methodas recited in claim 34, wherein obtaining packet header data from theshared set of interfaces is performed with the slave router.
 36. Themethod as recited in claim 34, wherein the forwarding data updatesinclude layer 2 protocol updates and the packet header data obtainedfrom the shared set of interfaces includes one or more shortcutsestablished by the master router, the one or more shortcuts specifyinglayer 3 forwarding information.
 37. The method as recited in claim 34,further comprising: maintaining a first routing table associated withthe master router; and maintaining a second routing table associatedwith the slave router.
 38. The method as recited in claim 37, whereinthe second routing table associated with the slave router is notrecalculated in response to a failure of the master router.
 39. Themethod as recited in claim 34, further comprising: updating the secondset of forwarding data in response to a failure of the master router.40. The method as recited in claim 39, wherein updating the second setof forwarding data comprises: invalidating one or more shortcutsestablished by the master router, the one or more shortcuts specifyinglayer 3 forwarding information.
 41. In a system including a first routerand a second router having a shared set of interfaces, a firstforwarding engine coupled to the set of interfaces and the first router,the first forwarding engine being associated with a first set offorwarding engine tables for facilitating forwarding of packets inhardware, and a second forwarding engine coupled to the set ofinterfaces and the second router, the second forwarding engine beingassociated with a second set of forwarding engine tables forfacilitating forwarding of packets in hardware, a method of forwarding apacket received at the set of interfaces comprising: sending at leastone of synchronized state information indicating states of portsassociated with the set of interfaces and VLAN membership of the firstrouter to the second router; observing the packet at the set ofinterfaces to obtain information from the packet; and updating the firstand second sets of forwarding engine tables with the obtainedinformation such that the packet is associated with at least one of thefirst router and the second router, thereby enabling the first routerand the second router to forward a packet using the obtainedinformation.
 42. The method as recited in claim 41, wherein the firstforwarding engine has an associated layer 2 table and layer 3 table, andthe second forwarding engine has an associated layer 2 table and layer 3table, wherein the layer 2 tables each associate one or more MACaddresses with the first router or the second router, and wherein thelayer 3 tables each specify one or more shortcuts including layer 3forwarding information, each one of the shortcuts being associated witha flow associated with a source IP address and destination IP address,the method further comprising: detecting a failure of the master router;and updating entries in the layer 2 table associated with the slaverouter such that each one of the entries is mapped to the slave routerrather than the master router.
 43. The method as recited in claim 42,further comprising: removing selected entries in the layer 3 tableassociated with the slave router, the selected entries specifyingshortcuts associated with the master router, thereby enablingreplacement entries to be created upon forwarding of packets such thatthe replacement entries specify shortcuts associated with the slaverouter.
 44. The method as recited in claim 43, further comprising:forwarding a packet via the second forwarding engine.
 45. The method asrecited in claim 41, wherein the first router has an associated firstrouting table for facilitating forwarding of packets in software and thesecond router has an associated second routing table for facilitatingforwarding of packets in software, the method further comprising:running a first routing protocol on the first router and a secondrouting protocol on the second router; and separately building the firstrouting table and the second routing table.
 46. The method as recited inclaim 45, wherein the first routing protocol and the second routingprotocol are different.
 47. The method as recited in claim 45, whereinthe first routing protocol and the second routing protocol areidentical.
 48. The method as recited in claim 15, wherein a plurality ofVLANs are coupled to the set of interfaces.
 49. The method as recited inclaim 48, further comprising: performing load distribution among thefirst router and the second router based upon a source of incomingpackets.
 50. The method as recited in claim 48, further comprising:associating the plurality of VLANs with one or more default gateways.51. The method as recited in claim 48, further comprising: associatingone or more of the plurality of VLANs with the default gateway.
 52. Themethod as recited in claim 15, further comprising: associating one ormore of the set of interfaces with the default gateway.
 53. The methodas recited in claim 49, wherein the source is one of the plurality ofVLANS.